package com.example.springboot.service;

import com.example.springboot.entity.Application;
import com.example.springboot.mapper.ApplicationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApplicationService {
    @Autowired
    private ApplicationMapper applicationMapper;

    public int save(Application application){
        if(application.getId()==null){
            if(application.getIsApprove()==null){
                application.setIsApprove("未审批");
            }
            return applicationMapper.insert(application);
        }else{
            return applicationMapper.update(application);
        }
    }
}
